package com.tsmti.webservice.entity;

import com.alibaba.fastjson.annotation.JSONField;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;

/**
 * @Package：com.tsmti.webservice.entity
 * @Class：RetrunMessage
 * @Description： TODO
 * @Author：zcw
 * @Date：Created in 2018/7/23 16:44
 * @Company:
 * @Version：
 * @Modified By:
 */
@XmlRootElement(name = "ReturnMsg")
@XmlAccessorType(XmlAccessType.FIELD)
public class ReturnMsg implements Serializable {
    private static final long serialVersionUID = 3538219950834176614L;

    /** 状态值*/
    @JSONField(name = "state")
    private int state;
    /** 消息内容*/
    @JSONField(name = "message")
    private Object message;

    public ReturnMsg() {
    }

    public ReturnMsg(int state, Object message) {
        this.state = state;
        this.message = message;
    }

    public static ReturnMsg success(int state, Object message){
        ReturnMsg r = new ReturnMsg();
        r.setState(state);
        r.setMessage(message);
        return r;
    }
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Object getMessage() {
        return message;
    }

    public void setMessage(Object message) {
        this.message = message;
    }
}
